﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;

namespace NJL.Web.Controls
{
    public partial class WUEnterPriseSpaceLeftBaseInfo : BaseUserControl
    {
        private readonly NJL.BLL.NJL_SYS_BASE bllBase = new BLL.NJL_SYS_BASE();
        private readonly NJL.BLL.NJL_COMPANY bllCompany = new BLL.NJL_COMPANY();
        NJL.BLL.NJL_REG_COMPANY_APPLY bllRegCompany = new BLL.NJL_REG_COMPANY_APPLY();
        protected NJL.Model.NJL_COMPANY modelCompany;
        protected NJL.Model.NJL_SYS_BASE MODEL_BASE;
        protected string companyid;
        NJL.BLL.NJL_MY_COLLECTION bllCollection = new BLL.NJL_MY_COLLECTION();
        protected void Page_Load(object sender, EventArgs e)
        {
            MODEL_BASE = bllBase.GetModel(WEBSITE_CODE);
            modelCompany = bllCompany.GetModel(Request.QueryString["id"].ToString());
            #region 获取认证照片
            if (!string.IsNullOrEmpty(modelCompany.AUDIT_INFO_1)&&modelCompany.AUDIT_STATE_1==1)
            {
                yezzimg.ImageUrl = GetImageUrl(modelCompany.AUDIT_INFO_1);
            }
            else
            {
                yezzimg.Visible = false;
            }
            if (!string.IsNullOrEmpty(modelCompany.AUDIT_INFO_2)&&modelCompany.AUDIT_STATE_2==1)
            {
                sudjimg.ImageUrl = GetImageUrl(modelCompany.AUDIT_INFO_2);
            }
            else
            {
                sudjimg.Visible = false;
            }
            if (!string.IsNullOrEmpty(modelCompany.AUDIT_INFO_3)&&modelCompany.AUDIT_STATE_3==1)
            {
                imgxgzz.ImageUrl = GetImageUrl(modelCompany.AUDIT_INFO_3);
            }
            else
            {
                imgxgzz.Visible = false;
            }
            #endregion
            if (modelCompany != null)
            {
                litCompanyName.Text = modelCompany.COMPANY_NAME;
                if (modelCompany.IMAGE_CODE != "")
                {
                    Image1.ImageUrl = GetImageUrl(modelCompany.IMAGE_CODE, "C2");
                }
                else
                {
                    Image1.ImageUrl = "~/Images/defaultShopHead.jpg";
                }
                if (modelCompany.IS_SHOW_CONTACT == 1)
                {

                    litContact.Text = modelCompany.CONTACT;
                    litMobelPhone.Text = modelCompany.MOBILE;
                    litTel.Text = modelCompany.TEL;
                    litQQ.Text = modelCompany.QQ;
                    litMsn.Text = modelCompany.MSN;
                    ltlFax.Text = modelCompany.FAX;
                    ltlPostCode.Text = modelCompany.POST_CODE;
                    ltlAddress.Text = modelCompany.ADDRESS;
                }
                else
                {
                    contact.Visible = false;
                }
            }
            if (UserId != "" && UserType == "1")
            {
                modelCompany = bllCompany.GetCompanyByUserIDModel(UserId);
                companyid = modelCompany.ID;
            }
            litAttention.Text = bllCollection.GetCollCountByTargetId(Request.QueryString["id"], "1").ToString();


        }
    }



}